cmake_minimum_required(VERSION 3.21)
project(pyvm_2025)

set(CMAKE_CXX_STANDARD 11)

#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wpedantic -Werror=return-type")
# 设置编译器标志 - 只针对缺失返回值
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
    # 只启用缺失返回值的警告，并视为错误
    add_compile_options(-Werror=return-type)

    # 可选：禁用其他警告的错误转换（保持为警告而非错误）
    # add_compile_options(-Wno-error)
endif()

add_executable(pyvm_2025 main.cpp
        util/arrayList.cpp
        util/map.cpp
        object/pyObject.cpp
        object/pyString.cpp
        object/pyInteger.cpp
        code/codeObject.cpp
        object/pyList.cpp
        code/binaryFileParser.cpp
        runtime/interpreter.cpp
        runtime/global.cpp
        object/klass.hpp
        runtime/frameObject.cpp
        runtime/functionObject.cpp)

INCLUDE_DIRECTORIES(./) # 指定头文件目录为当前目录，类似../util/xX.hpp可以简化为util/xX.hpp